<template>
  <footer class="aliali-footer">
    <div class="footer-container">
      <!-- 主要链接 -->
      <div class="footer-main">
        <div class="footer-links">
          <div class="link-group" v-for="group in linkGroups" :key="group.title">
            <h4 class="group-title">{{ group.title }}</h4>
            <a
                v-for="link in group.links"
                :key="link.name"
                :href="link.url"
                class="footer-link"
                target="_blank"
                rel="noopener noreferrer"
            >
              {{ link.name }}
            </a>
          </div>
        </div>
      </div>

      <!-- 版权信息 -->
      <div class="footer-bottom">
        <div class="copyright">
          <p>© 2024 aliali 版权所有</p>
          <div class="footer-meta">
            <span>营业执照</span>
            <span>网络文化经营许可证</span>
            <span>违法和不良信息举报</span>
            <span>联系我们</span>
          </div>
        </div>

        <div class="footer-social">
          <a
              v-for="social in socialLinks"
              :key="social.name"
              :href="social.url"
              class="social-link"
              target="_blank"
              rel="noopener noreferrer"
          >
            <span class="social-icon">{{ social.icon }}</span>
            <span class="social-name">{{ social.name }}</span>
          </a>
        </div>
      </div>
    </div>
  </footer>
</template>

<script setup>
import { ref } from 'vue'

// 链接分组数据
const linkGroups = ref([
  {
    title: '关于我们',
    links: [
      { name: '关于A站', url: '/about' },
      { name: '联系我们', url: '/contact' },
      { name: '用户协议', url: '/agreement' },
      { name: '加入我们', url: '/join' }
    ]
  },
  {
    title: '友情链接',
    links: [
      { name: '帮助中心', url: '/help' },
      { name: '侵权投诉', url: '/complaint' },
      { name: '广告合作', url: '/ad' }
    ]
  },
  {
    title: '内容合作',
    links: [
      { name: '创作中心', url: '/upload' },
      { name: '直播中心', url: '/live' },
      { name: '课堂', url: '/course' }
    ]
  }
])

// 社交媒体链接
const socialLinks = ref([
  { name: '微博', url: 'https://weibo.com', icon: '📱' },
  { name: '微信', url: 'https://weixin.qq.com', icon: '💬' },
  { name: 'QQ', url: 'https://qq.com', icon: '💻' }
])
</script>

<style scoped>
.aliali-footer {
  background: #f6f7f8;
  border-top: 1px solid #e7e7e7;
  margin-top: 40px;
  padding: 24px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e7e7e7;
}

.footer-links {
  display: flex;
  gap: 40px;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #18191c;
}

.footer-link {
  color: #61666d;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #00a1d6;
}

.footer-app {
  flex-shrink: 0;
}

.qrcode-section {
  text-align: center;
}

.qrcode {
  width: 80px;
  height: 80px;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  margin-bottom: 8px;
}

.qrcode-text {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.copyright {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.copyright p {
  margin: 0;
  font-size: 12px;
  color: #999;
}

.footer-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #ccc;
}

.footer-meta span {
  cursor: pointer;
  transition: color 0.3s ease;
}

.footer-meta span:hover {
  color: #999;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #666;
  font-size: 12px;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: #00a1d6;
}

.social-icon {
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-container {
    padding: 0 12px;
  }

  .footer-main {
    flex-direction: column;
    gap: 20px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-meta {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-social {
    justify-content: center;
  }
}
</style>